Now the site, there will always be a little interaction with the user features, such as allowing users to upload avatar, upload photos, upload attachments such as. PHP writes a program that is not very efficient for uploading files.Fortunately,
Implementation steps:1. Download 5.6, go to the official download 5.6 version, pay attention to the code to be consistent!Under Include folder, copy the FCKeditor folder to the Include folder in 5.7!2. Modify the background configuration: as shown
function _uploadpic ($upfile, $maxsize, $updir, $newname = ' Date ') {
if ($newname = = ' Date ')
$newname = Date ("Ymdhis"); Use date to make file name
$name = $upfile ["name"];
$type = $upfile ["type"];
$size = $upfile ["Size"];
$tmp _name =
This is a php file upload class with pictures displayed. In fact, it is possible to make a function. But it's still a little fun to do. ~ ~ ~
You should have used JS to verify the upload file type. But too lazy to do it.
Untitled
If the form cannot be submitted properly, modify the temporary file permissions ~ ~ ~ If you can submit the form normally, modify the upload file Small!!!Server on the use of apache2+php normal operation, replaced by Iis+php, has appeared php.ini
Example of a Drupal file upload form
Copy Code code as follows:
function Upload_form () {
$form = Array ();
If This #attribute isn't present, upload'll fail on submit
$form [' #attributes '] [' enctype '] = '
One, a relatively simple implementation of file upload
File Upload principle
File Upload principle: The client's files uploaded to the server side, and then the server-side temporary files moved to the specified directory.
Client Configuration
Previously wrote a STRUTS2 implementation of the file upload, this blog post is mainly to summarize the next SPRINGMVC implementation of file upload Steps. First take a look at the individual file upload, and then summarize the next multiple file
This is a php file upload class with pictures displayed. Actually make a function on it. But it's a little bit more fun. ~ ~ ~ ~ ~ ~ ~ ~ ~
You should have used JS to verify the type of upload file. But too lazy to do it.
Untitled Document
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.